const path = require('path'),
	  config = require(path.join(__dirname, '../config.js')),
	  redis = uniCloud.redis()

async function main(event) {
	let body = event.body
	if (body.key){
		let result = await redis.get(body.key)
		return {
			"code":200,
			"data":{
				"result":result
			},
			"msg":"success"
		}
	}else{
		return {
			"code":500,
			"data":false,
			"msg":"参数错误，缺少key"
		}
	}
	
}

module.exports = main